<div ng-cloak>

  <div uib-navbar profile="profile"></div>

  <div class="framework-main">
    <div uib-sidebar profile="profile" class="sidebar-full" is-collapse="role.isCollapse" groups="role.sidebarGroups" item-selected="role.sidebarSelected"></div>

    <div class="framework-body">
      <uib-breadcrumb class="breadcrumb-wrapper" breads="role.breads"></uib-breadcrumb>

      <div class="content">
        <nav class="navbar navbar-default navbar-search">
          <div class="container-fluid">
            <form name="search" class="navbar-form navbar-left" role="search" ng-submit="searchSubmit()">
              <div ng-if="cfg.hasAuth(profile, cfg.api.role.search.url)" class="form-group">
                <input type="text" ng-model="searchForm.keyWord" name="keyWord" class="form-control min-width-250px" placeholder="关键字">
              </div>
              <div ng-if="cfg.hasAuth(profile, cfg.api.role.search.url)" class="form-group">
                <button type="submit" class="btn btn-default btn-warning"><i class="fa fa-fw fa-search sr-only"></i> 查询</button>
              </div>
              <!--<div ng-if="cfg.hasAuth(profile, cfg.api.role.save.url)" class="form-group">
                <a ng-click="goview('roleview', 'create')" class="btn btn-default btn-success" uib-tooltip="新增" tooltip-append-to-body="true" tooltip-placement="top" ><i class="fa fa-fw fa-plus"></i><span class="hidden-xs"> 新增</span></a>
              </div>-->
            </form>
          </div>
        </nav>

        <div ng-if="page && !loading" class="table-container">
          <div class="table-responsive">
            <table class="table table-hover table-bordered table-vertical-middle table-nowrap">
              <thead>
              <tr>
                <!--<th class="text-center td-w45px">
                  <label class="label-checkbox">
                    <input type="checkbox" name="checkbox" ng-model="page.chAll" ng-change="checkAll(page)">
                    <i class="icon-checkbox"></i>
                  </label>
                </th>-->
                <th width="10%">角色名称</th>
                <th>角色描述</th>
                <th width="10%">操作</th>
              </tr>
              </thead>
              <tbody>
              <tr ng-repeat="row in page.list">
                <!--<td class="text-center td-w45px" data-id="{{row.id}}">
                  <label class="label-checkbox">
                    <input type="checkbox" name="checkbox" ng-model="row.ch" ng-click="check(page, row.ch)">
                    <i class="icon-checkbox"></i>
                  </label>
                </td>-->
                <td>{{row.name}}</td>
                <td>{{row.desc}}</td>
                <td>
                  <div ng-if="!row.empty">
                    <button type="button" class="btn btn-primary btn-sm" ng-click="goview('roleview', 'view', row.id)">详情</button>
                    <button ng-if="cfg.hasAuth(profile, cfg.api.role.update.url) && row.ticket_status !== 3 && (cfg.hasRoleId(profile.roles,'1') || cfg.hasRoleId(profile.roles,'8') || (cfg.hasRoleId(profile.roles,'9') && row.status !== 1) || (cfg.hasRoleId(profile.roles,'10') && row.status !== 1))" type="button" class="btn btn-warning btn-sm" ng-click="goview('roleview', 'edit', row.id)">编辑</button>
                    <!--<button ng-if="cfg.hasAuth(profile, cfg.api.role.delete.url)" type="button" class="btn btn-danger btn-sm" ng-click="operation('delete', row)">删除</button>-->
                  </div>
                  <div ng-if="row.empty" class="row-empty"></div>
                </td>
              </tr>
              </tbody>
            </table>
          </div>
          <nav class="pagination-container">

            <ul uib-pagination total-items="totalItems" ng-model="$parent.currentPage" items-per-page="itemsPerPage" max-size="maxSize" class="pagination pull-right" boundary-links="true" ng-change="pageChanged()" first-text="首页" previous-text="上一页" next-text="下一页" last-text="尾页"></ul>

            <div class="pagination-info pull-right">
              <span>{{currentPage}} / {{pageCount}}，共{{totalItems}}条</span>，<span>每页{{page.pageSize}}条</span>
            </div>
          </nav>
        </div>
      </div>

    </div>
  </div>

</div>
